﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace RBAC
{
    /// <summary>
    /// 针对用户操作的类
    /// 此对用户信息的任何操作都从此类出
    /// </summary>
    public class UserOperation
    {
        /// <summary>
        /// 给指写ID用户添加角色
        /// </summary>
        /// <param name="uid">用户ID</param>
        /// <param name="rid">角色ID</param>
        /// <param name="isPermit">是否有添加权限</param>
        /// <returns>返回操作结果</returns>
        public static bool AddRole(int uid,int rid)
        {
            return true;
        }
        /// <summary>
        /// 更改指写用户的角色
        /// </summary>
        /// <param name="uid">用户ID</param>
        /// <param name="rid">角色ID</param>
        /// <param name="isPermit"></param>
        /// <returns></returns>
        public static bool UpdateRole(int uid,int rid)
        {
            return true;
        }
        /// <summary>
        /// 删除指定用户的指定角色
        /// </summary>
        /// <param name="uid">用户ID</param>
        /// <param name="rid">角色ID</param>
        /// <returns></returns>
        public static bool DeleteRole(int uid,int rid)
        {
            return true;
        }
        /// <summary>
        /// 删除指定用户的多个角色
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="rid"></param>
        /// <param name="mistakeId">删除失败的角色ID号</param>
        /// <returns></returns>
        public static bool DeleteRole(int uid,List<int> rid,out int mistakeId)
        {
            mistakeId = 1;
            return true;
        }
    }
}
